package com.ddx.common.enums;

/**
 *  limit 限制交易表  枚举  withdraw.charge_type
 */
public enum ChargeType {

    RATE(1,"比例"),
    FIXED(0,"固定值"),
    FREE(2,"前两笔免费");

    private Integer code;
    private String msg;
    ChargeType(Integer code, String msg) {
        this.code=code;
        this.msg=msg;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public static ChargeType getChargeType(Integer code) {
        for (ChargeType t : ChargeType.values()) {
            if (code.equals(t.getCode())) {
                return t;
            }
        }
        return null;
    }

}
